﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using TraCuuDiemNhom3.Commons;

namespace TraCuuDiemNhom3
{
    public partial class XemDiemSV : System.Web.UI.Page
    {
        DataTable tblDiem;
        protected void Page_Load(object sender, EventArgs e)
        {
            string maSV = TienIchWeb.LayTenDangNhap();
           

        }
        //protected void btnXem_Click(object sender, EventArgs e)
        protected void btnXem_Click(object sender, EventArgs e)
        {

            string maSV = TienIchWeb.LayTenDangNhap();
            //string maSV = "0101020001";

            if(int.Parse(ddlHocKy.SelectedValue)==0)
                tblDiem = TienIchSQL.ChayLenhSelectDuLieu("Select * From Diem d  where d.MaSV=@user", "@user", maSV);                                            
            else
                tblDiem = TienIchSQL.ChayLenhSelectDuLieu("Select * From Diem d  where d.HocKy= @hocKy and d.MaSV=@user", "@hocKy", ddlHocKy.SelectedValue, "@user", maSV);                                            
            
            gvDiem.DataSource = tblDiem;
            gvDiem.DataBind();                                      
           
          
        }

            
    }
}